<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Resources\CourseResourceCollection;
use Illuminate\Http\Request;
use App\Models\Courses as CourseModel;

class Courses extends Controller
{
    //
    public function getCourses(Request $request)
    {
        $params = $request->except(['s']);
        $courses = CourseModel::where(['cate_id'=>$params['cate_id']])->get();
        return response()->json(['status'=>200,'data'=>new CourseResourceCollection($courses),'msg'=>'请求成功']);
    }

    //获取课程视频链接
    public function getCourseVideo(Request $request)
    {
        dump($request->all());
        exit();
    }
}
